home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / linuxdoc-sgml-1.1 / sgmls-1.1 / std.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  2.4 KB  |  117 lines

  1. /* std.h -
  2.    Include standard header files.
  3. */
  4.  
  5. #ifndef STD_H
  6. #define STD_H 1
  7.  
  8. #include <stdio.h>
  9. #include <ctype.h>
  10. #include <errno.h>
  11. #include <assert.h>
  12. #ifdef SUPPORT_SUBDOC
  13. #include <signal.h>
  14. #endif /* SUPPORT_SUBDOC */
  15.  
  16. #ifndef STDDEF_H_MISSING
  17. #include <stddef.h>
  18. #endif /* not STDDEF_H_MISSING */
  19.  
  20. #ifndef LIMITS_H_MISSING
  21. #include <limits.h>
  22. #endif /* not LIMITS_H_MISSING */
  23.  
  24. #ifndef UINT_MAX
  25. #define UINT_MAX (sizeof(unsigned int) == 2 ? 0x7fff : \
  26.   (sizeof(unsigned int) == 4 ? 0x7fffffff : cant_guess_UINT_MAX))
  27. #endif
  28.  
  29. #ifdef VARARGS
  30. #include <varargs.h>
  31. #else
  32. #include <stdarg.h>
  33. #endif
  34.  
  35. #ifdef BSD_STRINGS
  36. #include <strings.h>
  37. #define memcpy(to, from, n) bcopy(from, to, n)
  38. #define memcmp(p, q, n) bcmp(p, q, n)
  39. #define strchr(s, c) index(s, c)
  40. #define strrchr(s, c) rindex(s, c)
  41. #else /* not BSD_STRINGS */
  42. #include <string.h>
  43. #endif /* not BSD_STRINGS */
  44.  
  45. #ifdef STRERROR_MISSING
  46. #ifdef USE_PROTOTYPES
  47. extern char *strerror(int);
  48. #else
  49. extern char *strerror();
  50. #endif
  51. #endif /* STRERROR_MISSING */
  52.  
  53. #ifdef STDLIB_H_MISSING
  54. UNIV malloc();
  55. UNIV calloc();
  56. UNIV realloc();
  57. char *getenv();
  58. long atol();
  59. #else /* not STDLIB_H_MISSING */
  60. #include <stdlib.h>
  61. #endif /* not STDLIB_H_MISSING */
  62.  
  63. #ifdef REMOVE_MISSING
  64. #ifdef HAVE_UNISTD_H
  65. #include <unistd.h>
  66. #endif /* HAVE_UNISTD_H */
  67. #define remove unlink
  68. #endif /* REMOVE_MISSING */
  69.  
  70. #ifdef RAISE_MISSING
  71. #ifdef HAVE_UNISTD_H
  72. #include <unistd.h>
  73. #endif /* HAVE_UNISTD_H */
  74. #define raise(sig) kill(getpid(), sig)
  75. #endif /* RAISE_MISSING */
  76.  
  77. #ifndef offsetof
  78. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  79. #endif
  80.  
  81. #ifndef EXIT_FAILURE
  82. #define EXIT_FAILURE 1
  83. #endif
  84. #ifndef EXIT_SUCCESS
  85. #define EXIT_SUCCESS 0
  86. #endif
  87.  
  88. #ifndef SEEK_SET
  89. #define SEEK_SET 0
  90. #define SEEK_CUR 1
  91. #define SEEK_END 2
  92. #endif
  93.  
  94. #ifdef FPOS_MISSING
  95. typedef long fpos_t;
  96. #define fsetpos(stream, pos) fseek(stream, *(pos), SEEK_SET)
  97. #define fgetpos(stream, pos) ((*(pos) = ftell(stream)) == -1L)
  98. #endif /* FPOS_MISSING */
  99.  
  100. /* Old BSD systems lack L_tmpnam and tmpnam().  This is a partial
  101. emulation using mktemp().  It requires that the argument to tmpnam()
  102. be non-NULL. */
  103.  
  104. #ifndef L_tmpnam
  105. #define tmpnam_template "/tmp/sgmlsXXXXXX"
  106. #define L_tmpnam (sizeof(tmpnam_template))
  107. #undef tmpnam
  108. #define tmpnam(buf) \
  109.   (mktemp(strcpy(buf, tmpnam_template)) == 0 || (buf)[0] == '\0' ? 0 : (buf))
  110. #endif /* not L_tmpnam */
  111.  
  112. #ifndef errno
  113. extern int errno;
  114. #endif
  115.  
  116. #endif /* not STD_H */
  117.